package com.example.ordersystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.ordersystem.entity.Food;
import com.example.ordersystem.entity.Order;
import com.example.ordersystem.entity.vo.FoodVo1;
import com.example.ordersystem.entity.vo.OrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Select("select a.*,b.num foodNum from food a\n" +
            "join orders_food b\n" +
            "on a.id=b.food_id\n" +
            "join orders c\n" +
            "on b.order_id=c.orderId\n" +
            "where  c.orderId=#{orderId}")
    List<OrderVo> viewDetail( String orderId);
}
